import { axiosInstance } from './config';
export const getBannerRequset = () => {
  return axiosInstance.get('/banner');
};
// 获取推荐数据
export const getRecommendListRequest = () => {
  return axiosInstance.get('/personalized');
};
// 获取热门歌手数据
export const getHotSingerListRequest = (count) => {
  return axiosInstance.get(`/top/artists?offset=${count}`);
};
// 获取类别歌手数据
export const getSingerListRequest = (category, alpha, count) => {
  const type = category ? category.type : '';
  const area = category ? category.area : '';
  const lowAlpha = alpha ? alpha.name.toLowerCase() : '';
  return axiosInstance.get(
    `/artist/list?type=${type}&area=${area}&initial=${lowAlpha}&offset=${count}`
  );
};
// 获取排名列表数据
export const getRankListRequest = () => {
  return axiosInstance.get(`/toplist/detail`);
};
// 获取Album列表数据
export const getAlbumDetailRequest = (id) => {
  return axiosInstance.get(`/playlist/detail?id=${id}`);
};
//  获取歌手的信息
export const getSingerInfoRequest = (id) => {
  return axiosInstance.get(`/artists?id=${id}`);
};
//拼接出歌曲的url链接
export const getSongUrl = (id) => {
  return `https://music.163.com/song/media/outer/url?id=${id}.mp3`;
};

export const getSongDetailRequest = id => {
  return axiosInstance.get(`/song/detail?ids=${id}`);
};
// 请求歌词
export const getLyricRequest = id => {
  return axiosInstance.get (`/lyric?id=${id}`);
};